<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateSalesmanWithdrawTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('salesman_withdraw', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('salesmanid')->comment('地推人员id');
            $table->decimal('accountmoney', 16,2)->default(0.00)->comment('提现金额');
            $table->dateTime('accounttime')->comment('提现时间');
            $table->string('accountmonth',256)->comment('提现月份');
            $table->integer('registernum')->default(0)->comment('注册数量');
            $table->integer('ordernum')->default(0)->comment('订单数量');
            $table->decimal('ordertotalamount',16,2)->default(0.00)->comment('订单总金额');
            $table->integer('rechargenum')->default(0)->comment('充值数量');
            $table->decimal('rechargetotalamount',16,2)->default(0.00)->comment('充值总金额');
            $table->decimal('balance',16,2)->default(0.00)->comment('余额');
            $table->tinyInteger('status')->comment('状态');
            $table->integer('adminid')->default(0)->comment('操作人id');
            $table->string('info', 128)->nullable()->comment('预留');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('salesman_withdraw');
    }
}
